Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Add proxy support for extension installation. #6911

Merged
merged 1 commit into from
Feb 20, 2014

Conversation

dangoor
Copy link
Contributor

@dangoor dangoor commented Feb 18, 2014

Configurable via a "proxy" preference (which could be used for other parts of
Brackets that should use HTTP proxy).

This fixes #6241, #5958 and this backlog item

Configurable via a "proxy" preference (which could be used for other parts of
Brackets that should use HTTP proxy).

This fixes #6241, #5958 and [this backlog item](https://trello.com/c/SEV95fdK/902-support-for-a-proxy-in-extensions-installation)
@dangoor
Copy link
Contributor Author

dangoor commented Feb 18, 2014

For anyone wanting to test this, you can easily do so by running the script at this page in Node and setting the "proxy" configuration variable.

@JeffryBooher
Copy link
Contributor

@dangoor how do the preferences work? I'm not sure what I'm testing there.

@dangoor
Copy link
Contributor Author

dangoor commented Feb 20, 2014

Ahh, yes, that wasn't clear. In your user config file (the one available from Debug/Open Preferences File), add this:

    "proxy": "http://localhost:8080/"

and then run that script that I linked to above (make sure you use -d -p 8080 when you run the script, as they do in their example). You should be able to install extensions and you'll see the proxy script logging the traffic flowing through it.

function _cmdDownloadFile(downloadId, url, callback) {
function _cmdDownloadFile(downloadId, url, proxy, callback) {
// Backwards compatibility check, added in 0.37
if (typeof proxy === "function") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not if (typeof proxy !== "string") instead?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh nevermind, maybe you need else if (typeof proxy !== "string") just to make sure we're not passing garbage in

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

disregard that as well. I see we don't really do much parameter validation as it is.

@JeffryBooher
Copy link
Contributor

Looks good. Merging.

JeffryBooher added a commit that referenced this pull request Feb 20, 2014
Add proxy support for extension installation.
@JeffryBooher JeffryBooher merged commit 16991f2 into master Feb 20, 2014
@JeffryBooher JeffryBooher deleted the dangoor/extman-proxy branch February 20, 2014 21:45
@brunowego
Copy link

👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support extension manager behind proxy
3 participants